public class test11 {
    public static int counnt=0;
    public static void main(String[] args) throws InterruptedException {
        Object lock=new Object();

        Thread t1=new Thread(()->{
            for (int i = 0; i <10_0000 ; i++) {
                synchronized (lock){
                    counnt++;
                }
            }
        });
        Thread t2=new Thread(()->{
            for (int i = 0; i <10_0000 ; i++) {
                synchronized (lock){
                    counnt++;
                }
            }
        });

        t1.start();
        t2.start();
        Thread.sleep(3000);
        System.out.println(counnt);
    }
}
